package org.cfx.basic.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import org.cfx.org.domain.Department;

import javax.validation.constraints.Email;
import java.io.Serializable;
import java.util.Date;

@Data
public class UserExportVO implements Serializable {

    @Excel(name = "编号")
    private Long id;

    @Excel(name = "姓名")
    private String username;

    @Excel(name = "密码")
    private String password;

    @Email(message = "请填写正确的邮箱地址")
    @Excel(name = "邮箱")
    private String email;

    @Excel(name = "头像路径")
    private String headImage;

    @Excel(name = "年龄")
    private Integer age;

    @Excel(name = "部门id")
    private Long department_id;

    private Department department;

    @Excel(name = "部门名称")
    private String deptName;

    public static final ThreadLocal<Integer> threadLocal_collectionSize = new ThreadLocal<>();
    public static final ThreadLocal<Integer> threadLocal_insertIndex = new ThreadLocal<>();

    public String getUsername() {
        Integer insertIndex = threadLocal_insertIndex.get();
        // System.out.println( "call get name " + name  + " " + insertIndex + "/" + threadLocal_collectionSize.get());
        insertIndex++;
        threadLocal_insertIndex.set( insertIndex );
        return username;
    }


}